Search Unix Commands/Scripts


  Help us in improving the repository. Add new commands/scripts through 'Submit Commands/Scripts ' link.





Unix Commands/Scripts for '#Find files' - 6 Commands/Scripts found

 Sample 1. Finding any of the multiple texts strings in file

egrep 'Error|Exception|Debug' logfile.txt

   Like      Feedback     egrep   grep log  grep


 Sample 2. Finding text within .gz (zipped) file without unzipping them

zgrep -i Error *.gz

   Like      Feedback     grep  zgrep  zgrep -i  grep within zipped file


 Sample 3. Get all Errors in a log file for last n days in a seperate error file

find /LogFilesfolder/ -iname "SystemOut*" -mtime -7 -exec zgrep "| ERROR |" {} ; >> logReport.txt

   Like      Feedback     find  -iname  -mtime  zgrep  find errors in log file


 Sample 4. Report the file size of all files bigger than 2 mb and older than 30 days

find . -type f -size +4096 -atime +30 -exec du -sk '{}' ;

   Like      Feedback     find   du   -exec  find files


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
 Sample 5. Find text within files of a directory recursively

grep -R "<text>"

   Like      Feedback     


 Sample 6. How to find lines in a file "File" containing "some text" ?

grep "some Text" File

   Like      Feedback     



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner